import re

s = '1000000001'

r = re.findall('^\\d{4,8}$', s)

print(r)
